package xcmg.device.dao.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import xcmg.device.dao.entity.marketing.MarketingMaterialsDO;
import xcmg.device.service.vo.basic.MarketingMaterialsConditionVO;
import xcmg.device.service.vo.marketing.MarketingMaterialsVO;

@Mapper
public interface MarketingMaterialsMapper {
    int deleteByPrimaryKey(String id);

    int insert(MarketingMaterialsDO record);

    MarketingMaterialsVO item(String id);

    int update(MarketingMaterialsDO record);

    int deleteByActivityId(String activityId);

    List<MarketingMaterialsVO> materialsList(@Param("orgId")String orgId, @Param("materialsNo")String materialsNo);

    List<MarketingMaterialsVO> materialsListAll(@Param("orgId")String orgId, @Param("materialsNo")String materialsNo);

    MarketingMaterialsVO itemPriceGroup(@Param("orgId")String orgId, @Param("materialsNo")String materialsNo, @Param("priceGroup")String priceGroup);

    MarketingMaterialsVO itemByActivityMaterials(@Param("orgId")String orgId,@Param("materialsNo")String materialsNo,@Param("activityId")String activityId);

    int deleteForUpdate(@Param("orgId")String orgId);

    int batchInsert(List<MarketingMaterialsDO> list);

   String getIdByActivityMaterials(@Param("orgId")String orgId,@Param("materialsNo")String materialsNo,@Param("activityId")String activityId);

   List<MarketingMaterialsVO> getMaterialsByActivityId(MarketingMaterialsConditionVO condition);
   
   List<MarketingMaterialsVO> getMaterialsPriceByActivityId(MarketingMaterialsConditionVO condition);
   
   int mergeInto(MarketingMaterialsDO marketingMaterialsDO);
   
   BigDecimal getPriceByMarketType(@Param("orgId") String orgId, @Param("materialsNo") String materialsNo, @Param("priceType") String priceType);
   
   int listCountByActivityId(String activityId);
   
   List<MarketingMaterialsDO> listMaterialsByActivityId(@Param("activityId") String activityId, @Param("startNum") int startNum, @Param("endNum") int endNum);
}